<?php
/**
 * File : ViewTranslation.php
 * Created by Ludovic Reenaers
 * Created on  4 nov. 2010
 * lreenaers@hotmail.com
 */
class ViewTranslation extends View{
	function edit($tab){
		$data = '<form ACCEPT-CHARSET="UTF-8" action="'.$_SESSION['config']->controler.'?/translation/commit/" method="post">';
		foreach ($tab as $trans) {
			$data.='<br/><textarea name="'.$trans->getId().'">'.$trans->getLabel().'</textarea>';
		}
		$data.='<input type="submit" value="go" name = "go"/></form>';
		$this->setContent($data);
	}
	public function commit($str){
		$this->setContent($str);
	}
	public function add($generator){
		$this->setContent($generator->dump());
	}
	public function insert($bean){
		$this->redirect($_SESSION['config']->controler."?/translation/add/");
	}
}
?>